home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copyright © 1992-1993 Mark Pilgrim *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define BlockSize 10
- #define CorrectTime 3
-
- void TwoCorner(GrafPtr);
-
- /* One region starts at the top of the screen and moves down the right side
- (making triangles with the topleft of the screen). The other region starts
- at the bottom of the screen and moves up the left side (making triangles with
- the bottomright of the screen). */
-
- void TwoCorner(GrafPtr sourceGrafPtr)
- {
- RgnHandle curregion;
- Rect source;
- int gap;
-
- curregion=NewRgn();
- source.top=source.left=0;
- source.bottom=MAIN_WINDOW_HEIGHT;
- source.right=MAIN_WINDOW_WIDTH;
-
- gap=0;
- do
- {
- StartTiming();
- SetEmptyRgn(curregion);
- MoveTo(0,0);
- OpenRgn();
- Line(MAIN_WINDOW_WIDTH,gap);
- Line(0,BlockSize);
- LineTo(0,0);
- MoveTo(MAIN_WINDOW_WIDTH,MAIN_WINDOW_HEIGHT); /* region is discontinuous */
- Line(-MAIN_WINDOW_WIDTH,-gap); /* but this is much faster */
- Line(0,-BlockSize); /* than two regions & two */
- LineTo(MAIN_WINDOW_WIDTH,MAIN_WINDOW_HEIGHT); /* CopyBits */
- CloseRgn(curregion);
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &source, &source, 0, curregion);
- gap+=BlockSize;
- TimeCorrection(CorrectTime);
- }
- while (gap<MAIN_WINDOW_HEIGHT+BlockSize);
-
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &source, &source, 0, 0L); /* in case we missed any bits */
-
- DisposeRgn(curregion);
- }
-